package dto

import (
	"hc-admin/app/admin/models"
	"hc-admin/common/dto"
	common "hc-admin/common/models"
)

type BusUserDataGetPageReq struct {
	dto.Pagination `search:"-"`
	NameCht        string `form:"nameCht"  search:"type:exact;column:name_cht;table:bus_user_data" comment:"姓名(中文)"`
	NameEng        string `form:"nameEng"  search:"type:exact;column:name_eng;table:bus_user_data" comment:"姓名(英文)"`
	IdCard         string `form:"idCard"  search:"type:exact;column:id_card;table:bus_user_data" comment:"证件号码"`
	StaffId        string `form:"staffId"  search:"type:exact;column:staff_id;table:bus_user_data" comment:"客户主任编号"`
	BusUserDataOrder
}

type BusUserDataOrder struct {
	Id           string `form:"idOrder"  search:"type:order;column:id;table:bus_user_data"`
	NameCht      string `form:"nameChtOrder"  search:"type:order;column:name_cht;table:bus_user_data"`
	NameEng      string `form:"nameEngOrder"  search:"type:order;column:name_eng;table:bus_user_data"`
	IdCard       string `form:"idCardOrder"  search:"type:order;column:id_card;table:bus_user_data"`
	BankCert     string `form:"bankCertOrder"  search:"type:order;column:bank_cert;table:bus_user_data"`
	IdCardFile   string `form:"idCardFileOrder"  search:"type:order;column:id_card_file;table:bus_user_data"`
	StaffId      string `form:"staffIdOrder"  search:"type:order;column:staff_id;table:bus_user_data"`
	BirthDate    string `form:"birthDateOrder"  search:"type:order;column:birth_date;table:bus_user_data"`
	Job          string `form:"jobOrder"  search:"type:order;column:job;table:bus_user_data"`
	AnnualSalary string `form:"annualSalaryOrder"  search:"type:order;column:annual_salary;table:bus_user_data"`
	Nationality  string `form:"nationalityOrder"  search:"type:order;column:nationality;table:bus_user_data"`
	Email        string `form:"emailOrder"  search:"type:order;column:email;table:bus_user_data"`
	Equity       string `form:"equityOrder"  search:"type:order;column:equity;table:bus_user_data"`
	Addr         string `form:"addrOrder"  search:"type:order;column:addr;table:bus_user_data"`
	Sex          string `form:"sexOrder"  search:"type:order;column:sex;table:bus_user_data"`
	Status       string `form:"statusOrder"  search:"type:order;column:status;table:bus_user_data"`
	CreateBy     string `form:"createByOrder"  search:"type:order;column:create_by;table:bus_user_data"`
	UpdateBy     string `form:"updateByOrder"  search:"type:order;column:update_by;table:bus_user_data"`
	CreatedAt    string `form:"createdAtOrder"  search:"type:order;column:created_at;table:bus_user_data"`
	UpdatedAt    string `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:bus_user_data"`
	DeletedAt    string `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:bus_user_data"`
}

func (m *BusUserDataGetPageReq) GetNeedSearch() interface{} {
	return *m
}

type BusUserDataInsertReq struct {
	Id           int    `json:"-" comment:""` //
	NameCht      string `json:"nameCht" comment:"姓名(中文)"`
	NameEng      string `json:"nameEng" comment:"姓名(英文)"`
	IdCard       string `json:"idCard" comment:"证件号码"`
	BankCert     string `json:"bankCert" comment:"户口/银行卡资料"`
	IdCardFile   string `json:"idCardFile" comment:"身份证资料文件"`
	StaffId      string `json:"staffId" comment:"客户主任编号"`
	BirthDate    string `json:"birthDate" comment:"出生日期"`
	Job          string `json:"job" comment:"职业"`
	AnnualSalary string `json:"annualSalary" comment:"年薪"`
	Nationality  string `json:"nationality" comment:"国家"`
	Email        string `json:"email" comment:"电邮地址"`
	Equity       string `json:"equity" comment:"净资产"`
	Addr         string `json:"addr" comment:"现居住地址"`
	Sex          string `json:"sex" comment:"性别"`
	Status       string `json:"status" comment:"状态"`
	common.ControlBy
}

func (s *BusUserDataInsertReq) Generate(model *models.BusUserData) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.NameCht = s.NameCht
	model.NameEng = s.NameEng
	model.IdCard = s.IdCard
	model.BankCert = s.BankCert
	model.IdCardFile = s.IdCardFile
	model.StaffId = s.StaffId
	model.BirthDate = s.BirthDate
	model.Job = s.Job
	model.AnnualSalary = s.AnnualSalary
	model.Nationality = s.Nationality
	model.Email = s.Email
	model.Equity = s.Equity
	model.Addr = s.Addr
	model.Sex = s.Sex
	model.Status = s.Status
	model.CreateBy = s.CreateBy // 添加这而，需要记录是被谁创建的
}

func (s *BusUserDataInsertReq) GetId() interface{} {
	return s.Id
}

type BusUserDataUpdateReq struct {
	Id               int    `uri:"id" comment:""` //
	NameCht          string `json:"nameCht" comment:"姓名(中文)"`
	NameEng          string `json:"nameEng" comment:"姓名(英文)"`
	IdCard           string `json:"idCard" comment:"证件号码"`
	BankCert         string `json:"bankCert" comment:"户口/银行卡资料"`
	IdCardFile       string `json:"idCardFile" comment:"身份证资料文件"`
	StaffId          string `json:"staffId" comment:"客户主任编号"`
	BirthDate        string `json:"birthDate" comment:"出生日期"`
	Job              string `json:"job" comment:"职业"`
	AnnualSalary     string `json:"annualSalary" comment:"年薪"`
	Nationality      string `json:"nationality" comment:"国家"`
	Email            string `json:"email" comment:"电邮地址"`
	Equity           string `json:"equity" comment:"净资产"`
	Addr             string `json:"addr" comment:"现居住地址"`
	Sex              string `json:"sex" comment:"性别"`
	Status           string `json:"status" comment:"状态"`
	MidDepositMoney  string `gorm:"type:varchar(255);comment:中小企_存款资金" json:"midDepositMoney"`
	MidLeverageRatio string `gorm:"type:varchar(255);comment:中小企_信贷杠杆比率" json:"midLeverageRatio"`
	MidApproveMoney  string `gorm:"type:varchar(255);comment:中小企_批核金额" json:"midApproveMoney"`
	MidAPR           string `gorm:"type:varchar(255);comment:中小企_年利率" json:"midAPR"`

	PrivateDepositMoney  string `gorm:"type:varchar(255);comment:私人_存款资金" json:"privateDepositMoney"`
	PrivateLeverageRatio string `gorm:"type:varchar(255);comment:私人_信贷杠杆比率" json:"privateLeverageRatio"`
	PrivateApproveMoney  string `gorm:"type:varchar(255);comment:私人_批核金额" json:"privateApproveMoney"`
	PrivateAPR           string `gorm:"type:varchar(255);comment:私人_年利率" json:"privateAPR"`

	CircleDepositMoney  string `gorm:"type:varchar(255);comment:循环_存款资金" json:"circleDepositMoney"`
	CircleLeverageRatio string `gorm:"type:varchar(255);comment:循环_信贷杠杆比率" json:"circleLeverageRatio"`
	CircleApproveMoney  string `gorm:"type:varchar(255);comment:循环_批核金额" json:"circleApproveMoney"`
	CircleAPR           string `gorm:"type:varchar(255);comment:循环_年利率" json:"circleAPR"`

	MortgageValuation    string `gorm:"type:varchar(255);comment:按揭_估值" json:"mortgageValuation"`
	MortgagePercentage   string `gorm:"type:varchar(255);comment:按揭_成数" json:"mortgagePercentage"`
	MortgageApproveMoney string `gorm:"type:varchar(255);comment:按揭_批核金额" json:"mortgageApproveMoney"`
	MortgageAPR          string `gorm:"type:varchar(255);comment:按揭_年利率" json:"mortgageAPR"`

	FixedDepositMoney    string `gorm:"type:varchar(255);comment:定期_存款资金" json:"fixedDepositMoney"`
	FixedDepositDeadline string `gorm:"type:varchar(255);comment:定期_存款期限" json:"fixedDepositDeadline"`
	FixedDepositAPR      string `gorm:"type:varchar(255);comment:定期_年利率" json:"fixedDepositAPR"`

	InvestDepositMoney         string `gorm:"type:varchar(255);comment:投资_存款资金" json:"investDepositMoney"`
	InvestDepositNetWorth      string `gorm:"type:varchar(255);comment:投资_资金净值" json:"investDepositNetWorth"`
	InvestDepositFloatGainLoss string `gorm:"type:varchar(255);comment:投资_浮动盈亏" json:"investDepositFloatGainLoss"`

	BankNo                        string `gorm:"type:varchar(50);default:'';comment:银行_编号" json:"bankNo"`
	BankName                      string `gorm:"type:varchar(50);default:'';comment:银行_名称" json:"bankName"`
	BankAccountNo                 string `gorm:"type:varchar(50);default:'';comment:银行_账户号码" json:"bankAccountNo"`
	BankWithdrawalSilverCode      string `gorm:"type:varchar(50);default:'';comment:银行_提款银码" json:"bankWithdrawalSilverCode"`
	BankAccountIdentificationCode string `gorm:"type:varchar(50);default:'';comment:银行_转数快识别码" json:"bankAccountIdentificationCode"`
	common.ControlBy
}

func (s *BusUserDataUpdateReq) Generate(model *models.BusUserData) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.NameCht = s.NameCht
	model.NameEng = s.NameEng
	model.IdCard = s.IdCard
	model.BankCert = s.BankCert
	model.IdCardFile = s.IdCardFile
	model.StaffId = s.StaffId
	model.BirthDate = s.BirthDate
	model.Job = s.Job
	model.AnnualSalary = s.AnnualSalary
	model.Nationality = s.Nationality
	model.Email = s.Email
	model.Equity = s.Equity
	model.Addr = s.Addr
	model.Sex = s.Sex
	model.Status = s.Status
	model.MidDepositMoney = s.MidDepositMoney
	model.MidApproveMoney = s.MidApproveMoney
	model.MidLeverageRatio = s.MidLeverageRatio
	model.MidAPR = s.MidAPR
	model.PrivateAPR = s.PrivateAPR
	model.PrivateDepositMoney = s.PrivateDepositMoney
	model.PrivateApproveMoney = s.PrivateApproveMoney
	model.PrivateLeverageRatio = s.PrivateLeverageRatio
	model.CircleLeverageRatio = s.CircleLeverageRatio
	model.CircleAPR = s.CircleAPR
	model.CircleDepositMoney = s.CircleDepositMoney
	model.CircleApproveMoney = s.CircleApproveMoney
	model.MortgageValuation = s.MortgageValuation
	model.MortgagePercentage = s.MortgagePercentage
	model.MortgageApproveMoney = s.MortgageApproveMoney
	model.MortgageAPR = s.MortgageAPR
	model.FixedDepositMoney = s.FixedDepositMoney
	model.FixedDepositDeadline = s.FixedDepositDeadline
	model.FixedDepositAPR = s.FixedDepositAPR
	model.InvestDepositMoney = s.InvestDepositMoney
	model.InvestDepositNetWorth = s.InvestDepositNetWorth
	model.InvestDepositFloatGainLoss = s.InvestDepositFloatGainLoss
	model.BankNo = s.BankNo
	model.BankName = s.BankName
	model.BankAccountNo = s.BankAccountNo
	model.BankWithdrawalSilverCode = s.BankWithdrawalSilverCode
	model.BankAccountIdentificationCode = s.BankAccountIdentificationCode

	model.UpdateBy = s.UpdateBy // 添加这而，需要记录是被谁更新的
}

type BusUserDataBalanceUpdateReq struct {
	Id      int    `uri:"id" comment:""`
	Balance string `json:"balance" comment:"余额"`
	common.ControlBy
}

func (s *BusUserDataBalanceUpdateReq) Generate(model *models.BusUserData) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.Balance = s.Balance
	model.UpdateBy = s.UpdateBy // 添加这而，需要记录是被谁更新的
}

func (s *BusUserDataBalanceUpdateReq) GetId() interface{} {
	return s.Id
}

func (s *BusUserDataUpdateReq) GetId() interface{} {
	return s.Id
}

// BusUserDataGetReq 功能获取请求参数
type BusUserDataGetReq struct {
	Id int `uri:"id"`
}

func (s *BusUserDataGetReq) GetId() interface{} {
	return s.Id
}

// BusUserDataDeleteReq 功能删除请求参数
type BusUserDataDeleteReq struct {
	Ids []int `json:"ids"`
}

func (s *BusUserDataDeleteReq) GetId() interface{} {
	return s.Ids
}
